package com.fengmi.demo;

public enum Student  {

    //简写，必须放在最前面,多个用逗号，最后加;
    ZHANGSAN("zhangsan"),LISI("lisi");
    private String name;
    private Student(String name){
        this.name = name;
    }

    public static void main(String[] args) {
//
//        System.out.println(Student.ZHANGSAN.ordinal());   //顺序
//        System.out.println(Student.LISI.ordinal());   //顺序
//        Student[] values = Student.values();
//        for( Student s:values){
//            System.out.println(s);
//        }

//        Student zhangsan = Student.valueOf("ZHANGSAN");
//        System.out.println(zhangsan);0   -  1
        System.out.println(Student.ZHANGSAN.compareTo(Student.LISI));
    }
}
